<div class="panel panel-default panel-intro">
    <div class="panel-heading">
        <h3 class="panel-title">审核主动报工</h3>
    </div>
    <div class="panel-body">
        <div class="row">
            <div class="col-md-6">
                <h4>报工信息</h4>
                <table class="table table-bordered">
                    <tr>
                        <td width="120">订单号：</td>
                        <td>{$activeReport.order_no}</td>
                    </tr>
                    <tr>
                        <td>员工姓名：</td>
                        <td>{$activeReport.user_name}</td>
                    </tr>
                    <tr>
                        <td>产品型号：</td>
                        <td>{$activeReport.product_name} - {$activeReport.model_name}</td>
                    </tr>
                    <tr>
                        <td>生产数量：</td>
                        <td>{$activeReport.quantity} 件</td>
                    </tr>
                    <tr>
                        <td>工作时长：</td>
                        <td>{$activeReport.work_hours} 小时
                            {if condition="$activeReport.start_time && $activeReport.end_time"}
                            <br><small class="text-muted">{$activeReport.start_time} - {$activeReport.end_time}</small>
                            {/if}
                        </td>
                    </tr>
                    <tr>
                        <td>计件工资：</td>
                        <td>￥{$activeReport.piece_wage}</td>
                    </tr>
                    <tr>
                        <td>计时工资：</td>
                        <td>￥{$activeReport.time_wage}</td>
                    </tr>
                    <tr>
                        <td>总工资：</td>
                        <td><strong>￥{$activeReport.total_wage}</strong></td>
                    </tr>
                    <tr>
                        <td>工作日期：</td>
                        <td>{$activeReport.work_date}</td>
                    </tr>
                    <tr>
                        <td>备注：</td>
                        <td>{$activeReport.remark|default='无'}</td>
                    </tr>
                </table>
            </div>
            
            <div class="col-md-6">
                <h4>员工上传的完工图片</h4>
                <div class="row">
                    {volist name="workerImages" id="image"}
                    <div class="col-md-4 col-sm-6 mb-3">
                        <img src="{$image.image_url}" class="img-responsive img-thumbnail" style="height: 120px; width: 100%; object-fit: cover;">
                    </div>
                    {/volist}
                    {if condition="empty($workerImages)"}
                    <div class="col-12">
                        <p class="text-muted">暂无图片</p>
                    </div>
                    {/if}
                </div>
            </div>
        </div>
        
        <!-- 产品编号图片信息 -->
        {if condition="!empty($productItemImages)"}
        <div class="row">
            <div class="col-md-12">
                <h4>产品编号完工图片</h4>
                {volist name="productItemImages" id="images" key="itemNo"}
                <div class="panel panel-info">
                    <div class="panel-heading">
                        <h5 class="panel-title">产品编号：{$itemNo}</h5>
                    </div>
                    <div class="panel-body">
                        <div class="row">
                            {volist name="images" id="image"}
                            <div class="col-md-3 col-sm-4 col-xs-6 mb-3">
                                <img src="{$image}" class="img-responsive img-thumbnail" style="height: 120px; width: 100%; object-fit: cover;">
                            </div>
                            {/volist}
                        </div>
                    </div>
                </div>
                {/volist}
            </div>
        </div>
        {/if}
        
        <hr>
        
        <form id="auditForm" method="post" enctype="multipart/form-data">
            <input type="hidden" name="id" value="{$activeReport.id}">
            
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group">
                        <label>审核结果</label>
                        <div>
                            <label class="radio-inline">
                                <input type="radio" name="status" value="1" required> 通过
                            </label>
                            <label class="radio-inline">
                                <input type="radio" name="status" value="2" required> 拒绝
                            </label>
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <label>审核原因</label>
                        <textarea name="audit_reason" class="form-control" rows="3" placeholder="请输入审核原因"></textarea>
                    </div>
                </div>
                
                <div class="col-md-6">
                    <div class="form-group">
                        <label>验货图片（最多9张）</label>
                        <input type="file" name="audit_images[]" multiple accept="image/*" class="form-control">
                        <small class="text-muted">请上传验货图片作为审核依据</small>
                    </div>
                    
                    <div id="audit-image-preview" class="row"></div>
                </div>
            </div>
            
            <div class="form-group">
                <button type="submit" class="btn btn-success">提交审核</button>
                <a href="javascript:history.back()" class="btn btn-default">返回</a>
            </div>
        </form>
    </div>
</div> 